package basic.不同路径;

import java.util.Arrays;

/**
 * @author zhengTao
 * @version 1.0
 * @description: 不同路径
 * @date 2022/11/27 16:54
 */
public class Demo62 {
    public int uniquePaths(int m, int n) {
         int[][]  dp=new int[m][n];

        for (int i = 0; i < dp.length; i++) {
            for (int j = 0; j < dp[0].length; j++) {
                if(i==0){
                    dp[i][j]=1;
                }else if(j==0){
                    dp[i][j]=1;
                }else {
                    dp[i][j]=dp[i-1][j]+dp[i][j-1];
                }
            }
        }
        return dp[m-1][n-1];
    }
}
